<%--
  Created by IntelliJ IDEA.
  User: hp
  Date: 2021/3/28
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div id="bookrack" style="margin: 100px auto">
    <div class="chapter-list">
    <table style="width: 500px" border="1" cellpadding="5" cellspacing="0">
        <thead>
        <tr>un
            <th>nid</th>
            <th>nname</th>
            <th>chapterId</th>
            <th>hisTime</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="bookRact in bookRacts">
            <td>{{bookRact.nid}}</td>
            <td>{{bookRact.nname}}</td>
            <td>{{bookRact.chapterId}}</td>
            <td>{{bookRact.hisTime}}</td>
            <td>
<%--                <a href="">修改</a>|<a href="">删除</a>--%>
            </td>
        </tr>
        </tbody>
    </table>
    </div>
</div>
<script src="/comms/jquery.js"></script>
<script src="/comms/vue.js"></script>
<script src="/comms/base.js"></script>
<script>
    function request(url, method, fn, data) {
        $.ajax({
            url: url,
            data: data,
            method: method,
            dataType: "json",
            success: fn
        })
    }
</script>
<script>
    let v = new Vue({
        el: "#bookrack",
        data: {
            bookRacts: [],
        },
        created:function(){
            this.initList();
        },
        methods: {
            initList: function () {
                let this_ = this;
                request("/bookrack/showBookRacks","GET",function (data) {
                    if (data.flag){
                        this_.bookRacts = data.data;
                    }else {
                        console.log(data.message);
                    }
                })
            }
        }
    })

</script>

</body>
</html>